<form class="layui-form" action="{:url()}" method="post">
<div class="layui-tab-item layui-show">
    <div class="layui-form-item">
        <label class="layui-form-label">角色名称</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-name" name="name" lay-verify="required" autocomplete="off" placeholder="请输入角色名称">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色简介</label>
        <div class="layui-input-inline">
            <textarea  class="layui-textarea field-intro" name="intro" lay-verify="" autocomplete="off" placeholder="[选填]角色简介"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色状态</label>
        <div class="layui-input-inline">
            <input type="radio" class="field-status" name="status" value="1" title="启用" checked>
            <input type="radio" class="field-status" name="status" value="0" title="禁用">
        </div>
    </div>
</div>
<div class="layui-tab-item layui-form">
    <div class="layui-form-item" id="authShow"></div>
</div>
<div class="layui-form-item">
    <div class="layui-input-block">
        <input type="hidden" class="field-id" name="id">
        <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formSubmit">提交</button>
        <a href="{:url('role')}" class="layui-btn layui-btn-primary ml10"><i class="aicon ai-fanhui"></i>返回</a>
        <div style="display:none;" id="formBtn"></div>
    </div>
</div>
</form>
{include file="block/layui" /}
<script>
var formData = {:json_encode($formData)};
layui.use(['form', 'func', 'tree'], function() {
    var $ = layui.jquery, form = layui.form, tree = layui.tree;
    layui.func.assign(formData);
    tree.render({
        elem: '#authShow'
        ,id: 'id'
        ,showCheckbox: true
        ,data: {:json_encode($menus, 1)}
    });
});
</script>